using System;
using WiMo.Games.Audio;
using Microsoft.Xna.Framework.Audio;

namespace WiMo.Games.StandardAudio

{
    public class GameAudio : IGameAudio
    {
        private string fileName = string.Empty;

        SoundEffect _sound;

        public void Load(IContentManager contentManager, string name)
        {
             
        }

        public float Volume
        {
            get;
            set;
        }

        public void Play()
        {
            if(_sound!= null)
                _sound.Play(Volume, 0.0f, 0.0f);
        }

        public void Pause()
        {
            throw new NotImplementedException();
        }

        public void Stop()
        {
            throw new NotImplementedException();
        }

        public object AudioInformation
        {
            get { return _sound; }
            set { _sound = value as SoundEffect; }
        }

        public void Dispose()
        {
            var disposable = AudioInformation as IDisposable;
            if (disposable != null)
                disposable.Dispose();
        }
    }
}